﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace LyyCMS.Core.Models
{
    /// <summary>
    /// 网站
    /// </summary>
    [Table("Site")]
    public class Site : Entity<int>, IHasCreationTime, IHasDeletionTime, IFullAudited
    {
       
        [Required(ErrorMessage ="{0}不能为空")]
        [MinLength(3,ErrorMessage ="站点名称不能少于3个字符")]
        [DisplayName("网站名称")]
        public string SiteName { get; set; }

        [DisplayName("站点类型")]
        public SiteType SiteType { get; set; }

        [DisplayName("是否启用")]
        [Column(TypeName="bit")] //对于数据库字段类型 bit
        [DefaultValue(true)]
        public bool IsEnabled { get; set; }

        [DisplayName("是否默认站点")]
        [Column(TypeName = "bit")] //对于数据库字段类型 bit
        public bool IsDefault { get; set; }

        [Required(ErrorMessage ="{0}不能为空")]
        [DefaultValue(99)]
        [DisplayName("排序")]
        public int SortId { get; set; }
 
        /// <summary>
        /// SEO
        /// </summary>
        //public Seo Seo { get; set; }

        /// <summary>
        /// 频道信息
        /// </summary>
        public virtual ICollection<Channel> Channels { get; set; }


        [Required]
        [DisplayName("站点名称")]
        public string Name { get; set; }

        [DisplayName("Logo")]
        public string Logo { get; set; }

        [DisplayName("公司地址")]
        public string CompanyAddress { get; set; }

        [DisplayName("电话")]
        [Phone]
        public string Phone { get; set; }

        [DisplayName("传真")]
        public string Tex { get; set; }

        [DisplayName("邮箱")]
        public string Email { get; set; }

        [DisplayName("备案")]
        public string Record { get; set; }

        [DisplayName("版权")]
        public string CopyRight { get; set; }


        [DisplayName("创建时间")]
        public DateTime CreationTime { get; set; }
        [DisplayName("删除时间")]
        public DateTime? DeletionTime { get; set; }

        [DisplayName("已删除?")]
        public bool IsDeleted { get; set; }

        [DisplayName("创建人")]
        public long? CreatorUserId { get; set; }
        [DisplayName("修改人")]
        public long? LastModifierUserId { get; set; }
        [DisplayName("修改时间")]
        public DateTime? LastModificationTime { get; set; }
        [DisplayName("删除人")]
        public long? DeleterUserId { get; set; }
    }
}
